type A = Flatten<[1, 2, [3, 4], [[5]]]> // [1, 2, 3, 4, 5]
type Flatten<T> = T extends [infer First, ...infer Rest] ? First extends any[] ? [...Flatten<First>,...Flatten<Rest>] : [First,...Flatten<Rest>] : T

type B = Flatten<[1, 2, [3, 4], [[5]]]> // [1, 2, 3, 4, 5]
const a:A = [1, 2, 3, 4, 5]
const b:B = [1, 2, 3, 4, 5]





